$(function(){
    setLoginPlace();
    $('form').on('valid.form', function(e, form){
        layer.load();
        form.submit();
    });
});
function setLoginPlace() {
    var login = $('#login');
    var win = $(window);
    var doc = $('body');
    if(win.height() >= doc.height()) {
        login.addClass('loginCenter');
    } else {
        login.removeClass('loginCenter');
    }
    login.removeClass('hide');
}
function setFormResult(data) {
    if(data.status == 10000) {
        location.href = $('#login').attr('callbackUrl');
    } else {
        layer.closeAll();
        layer.alert(data.errmsg, 8);
    }
}